html, body {
  margin: 0;
  padding: 0;
  height: 100vh;
  font-family: Arial, sans-serif;
  display: flex;
  flex-direction: column;
}

.title-bar {
  -webkit-app-region: drag;
  background: #f0f0f0;
  padding: 8px;
  text-align: center;
  font-weight: bold;
  border-bottom: 1px solid #ddd;
  flex: 0 0 auto;
}

.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 16px;
  box-sizing: border-box;
  background-color: #fafafa;
}

.index-container-wrapper {
  margin-bottom: 10px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.index-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
  min-height: 36px;
}

.index-item {
  flex: 0 1 auto;
  font-size: 13px;
  padding: 4px 8px;
  background-color: #f8f9fa;
  border-radius: 4px;
  border: 1px solid #eee;
  white-space: nowrap;
  display: flex;
  align-items: center;
  transition: all 0.2s ease;
}

.index-item:hover {
  background-color: #f0f0f0;
  border-color: #ddd;
}

/* 调整涨跌幅的显示样式 */
.index-item .price-up,
.index-item .price-down {
  margin-left: 4px;
  font-weight: 500;
}

/* 优化指数名称和数值的间距 */
.index-item span {
  margin-left: 4px;
}

/* 添加响应式布局 */
@media (max-width: 400px) {
  .index-container {
    gap: 6px;
    padding: 6px;
  }
  
  .index-item {
    font-size: 12px;
    padding: 3px 6px;
  }
}

#stock-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  margin-bottom: 45px;
  padding: 4px;
}

.stock-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  margin: 5px 0;
  background-color: #fff;
  border: 1px solid #eee;
  border-radius: 8px;
  cursor: move;
  transition: all 0.3s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.stock-item:hover {
  background-color: #f8f9fa;
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.08);
}

.drag-handle {
  color: #999;
  margin-left: 20px;
  cursor: move;
  user-select: none;
}

.stock-info {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.stock-info > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stock-info > div:first-child > div:first-child {
  font-weight: 500;
  color: #333;
}

.stock-info > div:first-child > div:last-child {
  font-size: 12px;
  color: #888;
}

.stock-info > div:last-child {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stock-price {
  font-size: 16px;
  font-weight: 500;
}

.stock-change {
  font-size: 12px;
}

.price-up {
  color: #ff4d4f;
}

.price-down {
  color: #52c41a;
}

.toolbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: #f5f5f5;
  border-top: 1px solid #ddd;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
}

.settings-icon {
  cursor: pointer;
}

#settings-panel {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  z-index: 1000;
  width: 300px;
}

.search-result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px;
  border-bottom: 1px solid #eee;
}

.add-stock {
  padding: 4px 8px;
  background: #4CAF50;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.add-stock:hover {
  background: #45a049;
}

.no-result {
  padding: 8px;
  color: #666;
  text-align: center;
}

#stock-search {
  width: 100%;
  padding: 8px;
  box-sizing: border-box;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin-bottom: 10px;
}

#close-settings {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 20px;
  padding: 0;
  line-height: 1;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  transition: all 0.2s ease;
  border-radius: 4px;
}

#close-settings:hover {
  background-color: #eee;
  color: #333;
}

.settings-header {
  margin: -20px -20px 15px -20px;
  padding: 16px 20px;
  background-color: #f8f9fa;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  border-bottom: 1px solid #eee;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-content h3 {
  margin: 0;
  color: #333;
  font-size: 16px;
  font-weight: 500;
}

/* 响应式布局调整 */
@media (max-width: 300px) {
  .index-container {
    flex-direction: column;
  }
  .index-container > div {
    width: 100%;
  }
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
} 

@keyframes fadeOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(-20px);
  }
} 

.delete-btn {
  background: none;
  color: #ccc;
  border: none;
  padding: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 4px;
  width: 20px;
  height: 20px;
  opacity: 0;  /* 默认隐藏 */
  border-radius: 50%;
}

.stock-item:hover .delete-btn {
  opacity: 1;  /* 鼠标悬停时显示 */
}

.delete-btn:hover {
  background-color: rgba(255, 107, 129, 0.1);
  color: #ff6b81;
}

.delete-btn:active {
  transform: scale(0.95);
}

.import-export-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  
  /* 添加弹性布局实现居中 */
  display: flex;
  align-items: center;
  justify-content: center;
}

.import-export-modal .modal-content {
  position: relative;
  background-color: #fff;
  padding: 24px;
  width: 90%;
  max-width: 800px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  box-sizing: border-box;
  
  /* 移除之前的定位相关样式 */
  margin: 0;
  left: auto;
  transform: none;
  
  /* 添加最大高度限制和滚动 */
  max-height: 90vh;
  overflow-y: auto;
}

/* 调整小屏幕上的显示 */
@media (max-width: 480px) {
  .import-export-modal .modal-content {
    width: 95%;
    padding: 16px;
    max-height: 95vh;
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.close-modal {
  font-size: 24px;
  cursor: pointer;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.export-section,
.import-section {
  padding: 10px;
  border: 1px solid #eee;
  border-radius: 5px;
}

#import-file {
  width: 0.1px;
  height: 0.1px;
  opacity: 0;
  overflow: hidden;
  position: absolute;
  z-index: -1;
}

#import-file + label {
  background-color: #f5f5f5;
  color: #333;
  border: 2px dashed #ddd;
  padding: 12px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 10px 0;
  width: 100%;
  box-sizing: border-box;
}

#import-file + label:hover {
  border-color: #4CAF50;
  background-color: #f9f9f9;
  color: #4CAF50;
}

#import-file + label::before {
  content: "📁";
  font-size: 16px;
}

#import-file + label.file-chosen {
  border-style: solid;
  background-color: #e8f5e9;
  border-color: #4CAF50;
}

.import-export-icon {
  width: 20px;
  height: 20px;
  cursor: pointer;
  margin-left: 8px;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.import-export-icon:hover {
  opacity: 1;
} 

#export-btn,
#import-btn {
  background-color: #4CAF50;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 5px 0;
  width: 100%;
}

#export-btn:hover,
#import-btn:hover {
  background-color: #45a049;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#export-btn:active,
#import-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

/* 为按钮添加图标 */
#export-btn::before {
  content: "⭳";  /* 下载图标 */
  font-size: 16px;
}

#import-btn::before {
  content: "⭱";  /* 上传图标 */
  font-size: 16px;
} 

/* 添加时间显示区域的样式 */
.time-display {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #666;
}

/* 右侧图标容器样式 */
.toolbar > div:last-child {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 调整图标样式 */
.settings-icon,
.import-export-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
} 

/* 添加关于弹层样式 */
.about-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(3px);
  animation: modalFadeIn 0.3s ease;
}

.about-modal .modal-content {
  width: 80%;
  max-width: 500px;
  max-height: 70vh;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  animation: modalSlideIn 0.3s ease;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.about-modal .modal-header {
  padding: 12px 16px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #f8f9fa;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}

.about-modal .modal-header h3 {
  margin: 0;
  font-size: 16px;
  color: #333;
  font-weight: 500;
}

.about-modal .close-modal {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 24px;
  color: #666;
  transition: all 0.2s ease;
  background: transparent;
  border: none;
  padding: 0;
}

.about-modal .close-modal:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: #333;
}

.about-modal .modal-body {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
}

.about-modal .markdown-content {
  line-height: 1.6;
  color: #333;
  font-size: 14px;
}

/* 添加动画关键帧 */
@keyframes modalFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modalSlideIn {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* 响应式调整 */
@media (max-width: 480px) {
  .about-modal .modal-content {
    width: 90%;
    max-height: 80vh;
  }
  
  .about-modal .modal-header {
    padding: 10px 14px;
  }
  
  .about-modal .modal-body {
    padding: 12px;
  }
}

/* 自定义滚动条 */
.about-modal .modal-body::-webkit-scrollbar {
  width: 6px;
}

.about-modal .modal-body::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.about-modal .modal-body::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

.about-modal .modal-body::-webkit-scrollbar-thumb:hover {
  background: #999;
} 

/* 优化 Markdown 内容样式 */
.markdown-content {
  line-height: 1.5;  /* 减小行高 */
  color: #24292e;
  font-size: 13px;   /* 减小字体大小 */
  padding: 0 4px;    /* 添加小边距 */
}

.markdown-content h1 {
  padding-bottom: 0.2em;
  border-bottom: 1px solid #eaecef;
  margin: 16px 0 12px 0;  /* 减小标题间距 */
  font-size: 1.6em;
}

.markdown-content h2 {
  padding-bottom: 0.2em;
  border-bottom: 1px solid #eaecef;
  margin: 14px 0 10px 0;
  font-size: 1.4em;
}

.markdown-content h3 {
  margin: 12px 0 8px 0;
  font-size: 1.2em;
}

.markdown-content h4,
.markdown-content h5 {
  margin: 10px 0 6px 0;
  font-size: 1.1em;
}

.markdown-content p {
  margin: 0 0 8px 0;  /* 减小段落间距 */
}

.markdown-content ul,
.markdown-content ol {
  padding-left: 1.5em;  /* 减小列表缩进 */
  margin: 4px 0 8px 0;  /* 减小列表间距 */
}

.markdown-content li {
  margin: 2px 0;  /* 减小列表项间距 */
}

.markdown-content code {
  padding: 0.1em 0.3em;
  margin: 0;
  background-color: rgba(27, 31, 35, 0.05);
  border-radius: 3px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 90%;
}

.markdown-content pre {
  padding: 12px;  /* 减小代码块内边距 */
  margin: 8px 0;  /* 减小代码块外边距 */
  background-color: #f6f8fa;
  border-radius: 3px;
  overflow-x: auto;
}

.markdown-content blockquote {
  margin: 8px 0;
  padding: 0 0.8em;
  color: #6a737d;
  border-left: 0.25em solid #dfe2e5;
}

.markdown-content hr {
  height: 1px;  /* 减小分割线高度 */
  margin: 16px 0;
  background-color: #e1e4e8;
  border: 0;
}

.markdown-content table {
  margin: 8px 0;
  font-size: 12px;  /* 减小表格字体 */
}

.markdown-content table th,
.markdown-content table td {
  padding: 4px 8px;  /* 减小单元格内边距 */
}

/* 优化滚动条样式 */
.markdown-content::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

.markdown-content::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 2px;
}

.markdown-content::-webkit-scrollbar-track {
  background: #f1f1f1;
}

/* 调整图片大小 */
.markdown-content img {
  max-width: 100%;
  height: auto;
  margin: 8px 0;
}

/* 调整链接样式 */
.markdown-content a {
  color: #0366d6;
  text-decoration: none;
}

.markdown-content a:hover {
  text-decoration: underline;
} 

/* 调整模态框在小屏幕上的显示 */
@media (max-width: 480px) {
  .modal-content {
    margin: 10% auto;
    padding: 15px;
  }
} 